  {% include file="index.header.tpl.php" %}
  {% include file="index.left.tpl.php" %}
   <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form name="myform" action="" method="get">
                <div class="box-header with-border">
                    <span class="fa fa-table" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">卫生检查登记表</p>
                    <a href="index.php?a=sanitation.add" class="btn btn-warning btn-sm" style="float:right; margin-left:8px;">登 记</a>                   
                </div>
                   <div class="box-body">
                    <div class="col-sm-4 form-group">
						  <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding:0;">
							   学年学期：
						  </label>
						  <div class="input-group col-sm-8 col-xs-12">
							   <select class="form-control" name="semester_id" id="semester_id" style="padding:0;">
                                      <option value="">请选择</option>
									{%foreach from=$semester_lists key=key item=value%}
									  <option value="{%$value.semester_id%}"{%if $value.semester_id==$semester_id%}selected{%/if%}>
									  {%$value.semester_name%}</option>
									{%/foreach%}>
                                </select>
						  </div> 
				     </div>
                     <div class="col-sm-3 form-group">
						  <label for="inputPassword3" class="col-sm-3 control-label" style="padding:0;">
							   周次：
						  </label>
						  <div class="input-group col-sm-5 col-xs-12" style="float:left; margin-right:6px;">
							   <select class="form-control" name="sanitation_week_num" id="week_id" style="padding:0;">
                                      <option value="">请选择</option>
									  {%foreach from=$week_lists key=key item=value%}
									  <option value="{%$value.week_number%}"{%if $value.week_number == $sanitation_week_num%}selected{%/if%}>{%$value.week_number%}</option>
									  {%/foreach%}
                                </select>
						  </div>
						  <input type="hidden" name="a" value="sanitation.list">
                          <button class="btn btn-primary">确 定</button>
				     </div>  
                     <div style="clear:both; height:10px;"></div>
                   <h4 class="text-center">{%$semester_data.semester_name%}第{%$sanitation_week_num%}周各班卫生情况检查登记表</h4>
                      <table class="table table-bordered"  id="mytable">
                                    <tr>
									    <td rowspan="2">班级</td>
                                        <td colspan="2" align="center">星期一</td>
										<td colspan="2" align="center">星期二</td>
                                        <td colspan="2" align="center">星期三</td>
										<td colspan="2" align="center">星期四</td>
                                        <td colspan="2" align="center">星期五</td>
										<td colspan="2" align="center">合计</td>
                                    </tr>
									
                                    <tr>
                                        <td>常规</td>
										<td>其他</td>
                                        <td>常规</td>
										<td>其他</td>
                                        <td>常规</td>
										<td>其他</td>
										<td>常规</td>
										<td>其他</td>
										<td>常规</td>
										<td>其他</td>
                                        <td>常规</td>
										<td>其他</td>
                                    </tr>
									{%foreach from=$class_lists key=key item=value%}
                                     <tr>
									 <td>{%$value.class_name%}</td>
										{%foreach from=$value.infos key=ke item=va%}
                                        <td>{%$va.sanitation_rule%}</td>
										<td>{%$va.sanitation_rests%}</td>
										{%/foreach%}
                                         <!--<td>{%$value.content.sanitation_rule%}</td>
										<td>{%$value.content.sanitation_rests%}</td>-->
                                    </tr>
                                   {%/foreach%}	
                        </table>
				   </div><!--box-body -->
   
               </form>
           </div><!--box box-default box-solid-->
        </section>   
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
{% include file="index.footer.tpl.php" %}
<!--      二级联动     -->
<script type="text/javascript">
        $(document).ready(function () {
            $("#semester_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=semester.weekjson",
			type:"get",
			data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
			   
                            //实例2个字符串变量来拼接下拉列表
                            var industr = "";
                            //使用jquery解析json中的数据
                            $.each(msg, function (n, value) {
                                industr += ("<option value=\"" + value.week_number + "\">" + value.week_number);
                                industr += ("</option>");
                            });

                            $("#week_id").html(industr);			   			   
			}
			});					

                }

            });

        });
</script>